import axios from 'axios'
import Vue from 'vue'

// const Url = 'http://localhost:8000/api/v1'
const Url = 'http://yanyeek.top:8000/api/v1'

axios.defaults.baseURL = Url
axios.interceptors.request.use(config => {
  config.headers.Authorization = `Bearer ${window.sessionStorage.getItem(
    'token'
  )}`
  return config
})

Vue.prototype.$http = axios

export { Url, axios }
